<?php

require_once (FRONTEND_PATH.'/config/params.php');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.

$ui_config = array(
	'basePath'=> FRONTEND_PATH,
	'name'=>'360数据分析平台',

    'language'=>'zh_cn',
	// preloading 'log' component
	'preload'=>array('log', 'bootstrap'),

	// autoloading model and component classes
	'import'=>array(
		'root.common.dal.*',
		'root.common.models.*',
		'root.common.components.*',
        'root.common.utils.*',
        'root.frontend.components.*',
        'root.frontend.models.*',
		'root.executor.workflow.actions.*',
		'root.executor.workflow.variables.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'Enter Your Password Here',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
            'generatorPaths'=>array(
                'bootstrap.gii', // since 0.9.1
            ),
		),
		
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
        'bootstrap'=>array(
            'class'=>'ext.bootstrap.components.Bootstrap',
            'responsiveCss'=>true,
        ),

		// uncomment the following to enable URLs in path-format
		/*
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		*/
		/*'db'=>array(
			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		),
		*/
		'db'=>array(
			'connectionString' => 'mysql:host=client05v.safe.zzbc.qihoo.net;dbname=dw',
			'emulatePrepare' => true,
            'enableParamLogging' =>  true,
            'enableProfiling' => true,
			'username' => 'dw',
			'password' => 'dwcloud360',
			'charset' => 'utf8',
		),
		'dwmart'=>array(
			'connectionString' => 'mysql:host=client05v.safe.zzbc.qihoo.net;dbname=dw_mart',
			'emulatePrepare' => true,
			'username' => 'dw',
			'password' => 'dwcloud360',
			'charset' => 'utf8',
			'class' => 'system.db.CDbConnection',
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
                    'maxFileSize' => 1024 * 1024,
                    'maxLogFiles' => 10,
                    'logPath' => LOG_PATH,
                    'logFile' => 'ui.log.wf',
					'levels'=>'error, warning',
				),
				array(
					'class'=>'CFileLogRoute',
                    'maxFileSize' => 1024 * 1024,
                    'maxLogFiles' => 10,
                    'logPath' => LOG_PATH,
                    'logFile' => 'ui.log',
					'levels'=>'info',
                ),
                array(
					'class'=>'CFileLogRoute',
                    'maxFileSize' => 1024 * 1024,
                    'maxLogFiles' => 10,
                    'logPath' => LOG_PATH,
                    'logFile' => 'ui.sql.log',
                    'categories'=> 'system.db.*',
					'levels'=>'trace, profile',
				),   
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'shupeng@360.cn',
	),
);
